import fetch from "@/utils/fetch";

// 说明：添加机械水表资料
// 接口：api/cb/flMachineMeterInfo
// 请求类型：Post
export function addFlMachineMeterInfo(obj) {
    return fetch({
        url: "api/cb/flMachineMeterInfo",
        method: "post",
        data: obj,
    });
}

// 说明：删除机械水表资料
// 接口：api/cb/flBluetoothMeterInfo/{ids}  /flBluetoothMeterInfo/{id}
// 请求类型：Delete
export function deleteFlBluetoothMeterInfo(idArr) {
    return fetch({
        url: "api/cb/flBluetoothMeterInfo/" + idArr,
        method: "delete",
    });
}

// 说明：删除机械水表资料
// 接口：api/cb/flMachineMeterInfo/{ids}
// 请求类型：Delete
export function deleteFlMachineMeterInfo(idArr) {
    return fetch({
        url: "api/cb/flMachineMeterInfo/" + idArr,
        method: "delete",
    });
}

// 说明：修改机械水表资料
// 接口：api/cb/flMachineMeterInfo/{id}
// 请求类型：Put
export function modifyFlMachineMeterInfo(id, obj) {
    return fetch({
        url: "api/cb/flMachineMeterInfo/" + id,
        method: "put",
        data: obj,
    });
}

// 说明：修改蓝牙水表资料
// 接口：api/cb/flBluetoothMeterInfo/{id}
// 请求类型：Put
export function modifyFlBluetoothMeterInfo(id, obj) {
    return fetch({
        url: "api/cb/flBluetoothMeterInfo/" + id,
        method: "put",
        data: obj,
    });
}

// 说明：机械水表资料分页查询(条件搜索)
// 接口：api/cb/flMachineMeterInfo/search/{page}/{size}
// 请求类型：Post
export function searchFlMachineMeterInfo(page, size, obj) {
    return fetch({
        url: "api/cb/flMachineMeterInfo/search/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}

// 说明：蓝牙水表资料分页查询(条件搜索)  /flBluetoothMeterInfo/search/{page}/{size}
// 接口：api/cb/flBluetoothMeterInfo/search/{page}/{size}
// 请求类型：Post
export function searchFlBluetoothMeterInfo(page, size, obj) {
    return fetch({
        url: "api/cb/flBluetoothMeterInfo/search/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}

// 说明：蓝牙水表模块收费  /flBuzinessMeterInfo/bluetoothSearch
// 接口：api/cb/flBluetoothMeterInfo/search/{page}/{size}
// 请求类型：Post
export function bluetoothSearch(params) {
    return fetch({
        url: "api/business/flBuzinessMeterInfo/bluetoothSearch",
        method: "post",
        params,
    });
}

// 说明：获取单个机械水表资料
// 接口：api/cb/flMachineMeterInfo/{id}
// 请求类型：get
export function getFlMachineMeterInfo(id) {
    return fetch({
        url: "api/cb/flMachineMeterInfo/" + id,
        method: "get",
    });
}

// 说明：获取单个蓝牙水表资料
// 接口：api/cb/flBluetoothMeterInfo/{id}
// 请求类型：get
export function getFlBluetoothMeterInfo(id) {
    return fetch({
        url: "api/cb/flBluetoothMeterInfo/" + id,
        method: "get",
    });
}
// 说明：导出xlsx
// 接口：api/cb/flMachineMeterInfo/exprotXls
// 请求类型：get
// export function exprotXls() {
//     return fetch({
//         url: 'api/cb/flMachineMeterInfo/exprotXls',
//         responseType: 'blob',
//         method: 'get'
//     })
// }

// 说明：员工管理导出Excel数据
// 接口：api/product/flEmployeeManage/exprotXls/{ids}
// 请求类型：post
// export function exprotXls(idArr,obj) {
//     return fetch({
//         url: `api/cb/flMachineMeterInfo/exprotXls/${idArr}`,
//         method: 'post',
//         responseType: 'blob',
//         data: obj
//     })
// }

export function exprotXls(obj) {
    return fetch({
        url: `api/cb/flMachineMeterInfo/exprotXls`,
        method: "post",
        responseType: "blob",
        data: obj,
    });
}
// 说明：蓝牙导出  /flBluetoothMeterInfo/exprotXls
// 接口：api/cb/flBluetoothMeterInfo/exprotXl
// post
export function exprotBuleXls(obj) {
    return fetch({
        url: `api/cb/flBluetoothMeterInfo/exprotXls`,
        method: "post",
        responseType: "blob",
        data: obj,
    });
}

// 说明：下载模板
// 接口：api/cb/flMachineMeterInfo/exprotExcelModel
// 请求类型：get
export function downTem() {
    return fetch({
        url: "api/cb/flMachineMeterInfo/exprotExcelModel",
        responseType: "blob",
        method: "get",
    });
}

// 说明：换表修改底数
// 接口：api/cb/flMachineMeterInfo/changeMeter/{id}/{value}
// 请求类型：get
export function changeMeter(id, value) {
    return fetch({
        url: `api/cb/flMachineMeterInfo/changeMeter/${id}/${value}`,
        method: "get",
    });
}

// GET /flMachineMeterInfo/changeMeter/{id}/{oldEnd}/{newStart}/{newEnd}
export function changeMeterNewOld(id, oldEnd, newWaterNo, newStart, newEnd) {
    return fetch({
        url: `api/cb/flMachineMeterInfo/changeMeter1/${id}/${oldEnd}/${newWaterNo}/${newStart}/${newEnd}`,
        method: "get",
    });
}
// 售后换表

export function changeMeterNewOldService(
    id,
    oldEnd,
    newWaterNo,
    newStart,
    newEnd
) {
    return fetch({
        url: `api/cb/flWaterMeterInfo/platformChangeMeter/${id}/${oldEnd}/${newWaterNo}/${newStart}/${newEnd}`,
        method: "get",
    });
}

// 水司校表 /flWaterMeterInfo/companyChangeReading
export function changeWaterService(id, readnum) {
    return fetch({
        url: `api/cb/flWaterMeterInfo/companyChangeReading/${id}/${readnum}`,
        method: "get",
    });
}